home *** CD-ROM | disk | FTP | other *** search
/ System Booster / System Booster.iso / Archives / HardwareProjects / i2clib38.lha / Docs / i2c.doc < prev    next >
Text File  |  1994-01-28  |  5KB  |  210 lines

  1. TABLE OF CONTENTS
  2.  
  3. i2c.library/AllocI2C
  4. i2c.library/FreeI2C
  5. i2c.library/GetI2COpponent
  6. i2c.library/InitI2C
  7. i2c.library/ReceiveI2C
  8. i2c.library/SendI2C
  9. i2c.library/SetDelay
  10. i2c.library/AllocI2C                                     i2c.library/AllocI2C
  11.  
  12.    NAME  
  13.         AllocI2C -- Allocate port and timer for use with I²C-bus hardware.
  14.  
  15.    SYNOPSIS
  16.         ret = AllocI2C (Delay_Type, Name);
  17.          D0                 D0       A1
  18.  
  19.         BYTE AllocI2C (UBYTE, char *);
  20.  
  21.    FUNCTION
  22.         Allocates the parallelport and needed bits to communicate according
  23.         to the I²C-bus standard specified by Philips.
  24.         If Timer-delay is used, this routine will also handle initializing
  25.         of the timer needed to keep the clock-frequency (SCL) under 100 KHz
  26.         as specified in the I²C-bus standard.
  27.  
  28.    INPUTS
  29.         Delay_Type      Specifies if a loop or a timer should be used
  30.                         to handle the SCL-delay. To get the best
  31.                         performance, it is recommended to use loop-delay
  32.                         on non-accelerated Amigas, and only use the timer-
  33.                         delay with accelerated Amigas.
  34.         Name            Name of the program using the I²C-bus hardware and
  35.                         thereby blocking the parallelport for other tasks.
  36.  
  37.    RESULTS
  38.         ret             Zero if no error. Detailed error-codes can be found
  39.                         in i2c_library.h
  40.  
  41.    NOTES
  42.         Remember to call InitI2C() after AllocI2C() before using SendI2C()
  43.         or ReceiveI2C().
  44.  
  45.    SEE ALSO
  46.  
  47.    BUGS
  48.  
  49. i2c.library/FreeI2C                                       i2c.library/FreeI2C
  50.  
  51.    NAME  
  52.         FreeI2C -- Deallocate port and bits after use of I²C-bus.
  53.  
  54.    SYNOPSIS
  55.         FreeI2C();
  56.  
  57.         void FreeI2C(void);
  58.  
  59.    FUNCTION
  60.         Deallocates the parallelport and used bits.
  61.         If Timer-delay was used, the timer will now be released.
  62.  
  63.    RESULTS
  64.  
  65.    NOTES
  66.         This function may only be called, if AllocI2C() returned zero.
  67.  
  68.    SEE ALSO
  69.  
  70.    BUGS
  71.  
  72. i2c.library/GetI2COpponent                         i2c.library/GetI2COpponent
  73.  
  74.    NAME  
  75.         GetI2COpponent -- Get name of task using the parallel-port.
  76.  
  77.    SYNOPSIS
  78.         ret = GetI2COpponent();
  79.  
  80.         STRPTR GetI2COpponent(void);
  81.  
  82.    FUNCTION
  83.         If AllocI2C returns I2C_PORT_BUSY or I2C_BITS_BUSY this function
  84.         can be called to get the name of the Task using the port.
  85.  
  86.    RESULTS
  87.         STRPTR to task using the parallel-port
  88.  
  89.    NOTES
  90.         Only call this function if AllocI2C returns I2C_PORT_BUSY or
  91.         I2C_BITS_BUSY.
  92.  
  93.    SEE ALSO
  94.  
  95.    BUGS
  96.  
  97. i2c.library/InitI2C                                       i2c.library/InitI2C
  98.  
  99.    NAME  
  100.         InitI2C -- Initializes the port and sets default I²C-bus conditions
  101.  
  102.    SYNOPSIS
  103.         InitI2C();
  104.  
  105.         void InitI2C(void);
  106.  
  107.    FUNCTION
  108.         Sets the needed bits for input/output-operation. After this, the
  109.         default I²C-bus condition will de set, that is both SDA and SCL
  110.         high.
  111.  
  112.    RESULTS
  113.  
  114.    NOTES
  115.         This function should be called right after AllocI2C() if AllocI2C()
  116.         returns zero.
  117.  
  118.    SEE ALSO
  119.  
  120.    BUGS
  121.  
  122. i2c.library/ReceiveI2C                                 i2c.library/ReceiveI2C
  123.  
  124.    NAME  
  125.         ReceiveI2C -- Receive bytes from the I²C-bus
  126.  
  127.    SYNOPSIS
  128.         error = ReceiveI2C(addr, number, data);
  129.           D0                D0    D1      A1
  130.  
  131.         UBYTE ReceiveI2C(UBYTE, int, UBYTE []);
  132.  
  133.    FUNCTION
  134.         Receive data from a device connected to the I²C-bus hardware.
  135.  
  136.    INPUTS
  137.         addr            Address of device to receive data from.
  138.         number          Number of bytes to receive from the specified device.
  139.         data            Array, where to put the received data.
  140.  
  141.    RESULTS
  142.         error           Zero if an error occurred during reception of data
  143.                         from the specified device.
  144.  
  145.    NOTES
  146.         Be sure, that the size of the data-array is the same or larger than
  147.         the requested number of bytes to receive.
  148.         
  149.    SEE ALSO
  150.  
  151.    BUGS
  152.  
  153. i2c.library/SendI2C                                       i2c.library/SendI2C
  154.  
  155.    NAME  
  156.         SendI2C -- Transmit bytes on the I²C-bus
  157.  
  158.    SYNOPSIS
  159.         error = SendI2C(addr, number, data);
  160.           D0             D0    D1      A1
  161.  
  162.         UBYTE SendI2C(UBYTE, int, UBYTE []);
  163.  
  164.    FUNCTION
  165.         Send data to a device connected to the I²C-bus hardware.
  166.  
  167.    INPUTS
  168.         addr            Address of device to receive the transmitted data.
  169.         number          Number of bytes to transmit from the array specified
  170.                         by data.
  171.         data            Array, where the data to be transmitted is placed in.
  172.  
  173.    RESULTS
  174.         error           Zero if an error occurred during transmitting the
  175.                         data to the specified device.
  176.  
  177.    NOTES
  178.  
  179.    SEE ALSO
  180.  
  181.    BUGS
  182.  
  183. i2c.library/SetDelay                                     i2c.library/SetDelay
  184.  
  185.    NAME  
  186.         SetDelay -- Set the delay for I²C-bus clock-rate
  187.  
  188.    SYNOPSIS
  189.         SetDelay(ticks);
  190.                    D0
  191.  
  192.         void SetDelay(ULONG);
  193.  
  194.    FUNCTION
  195.         Set the delay for the I²C-bus clock. This is needed on some Amiga's,
  196.         since the I²C-bus standard specifies the maximum clock-frequency
  197.         on SCL to 100 KHz.
  198.         If timer-delay is used, the input will be handled like UNIT_MICROHZ
  199.         in the delay-routine.
  200.  
  201.    RESULTS
  202.         Adjusts speed of operations on the I2C-bus
  203.  
  204.    NOTES
  205.  
  206.    SEE ALSO
  207.  
  208.    BUGS
  209.  
  210.